<?php
require_once $_SERVER['DOCUMENT_ROOT'].'/common.php';

if ($_POST)
{
	$result = user::register($_POST['user_email'], $_POST['user_nickname'], $_POST['user_password']);
	$register_result = $result > 0 ? "新用户注册成功！" : "注册失败！";
	if ($result>0)
	{
		user::login($_POST['user_nickname'], $_POST['user_password']);
		sys::gotoUrl('/', 500);
	}
}
page::printTop();
?>

<div style="text-align:center"><font color=red><?php echo $register_result; ?></font>（* 为必填项） <?php echo '<font color=red>'.$add_result.'</font>'; ?></div><hr />
<form method=post>
	<div style="width:150px;float:left;">&nbsp;</div>
	<div style="width:150px;float:left;text-align:right;">
		<div class="lineheight">[*] E-mail：</div>
		<div class="lineheight">[*] 昵称：</div>
		<div class="lineheight">[*] 登录密码：</div>
	</div>
	<div style="width:20px;float:left;">&nbsp;</div>
	<div style="float:left;">
		<div class="lineheight"><input name="user_email" maxlength=40 /></div>
		<div class="lineheight"><input name="user_nickname" maxlength=40 /></div>
		<div class="lineheight"><input type="password" name="user_password" maxlength=40 /></div>
		<div class="lineheight"><input style="display:block;clear:both;width:120px;" type="submit" value="OK！" /></div>
	</div>
			
</form>

<?php
page::printTail();
